//
//  CLWebViewBridge.h
//  CLBrowser
//
//  Created by 梁慧聪 on 2022/4/1.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
#import <YYKit/YYDispatchQueuePool.h>
#import <WebViewJavascriptBridge/WebViewJavascriptBridge.h>
@class CLWebView;
@interface CLWebViewBridgeQueue : NSObject
/** webview rsa加密线程池  **/
@property (nonatomic , strong) YYDispatchQueuePool *queuePool;

+ (instancetype)shareInstance;
@end

@interface CLWebViewBridge : WebViewJavascriptBridge


- (void)updateMessage:(NSDictionary *)param;

- (BOOL)shouldStartLoad:(NSURLRequest *)request pageUrl:(NSURL *)pageUrl;

- (void)registerCommand:(NSString *)cmd handler:(void (^)(id obj, void(^responseCallback)(id obj)))handler;

- (void)dispatchCommand:(NSString *)cmd message:(NSString *)message;

- (void)p_dispatchMessage:(NSString *)message forCommand:(NSString *)cmd;

- (void)callJSFunc:(NSString *)funcName withMessage:(NSString *)message;

- (void)callHandler:(NSString *)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback;
@end
